package com.g5.edu.controller;


import com.g5.edu.model.DfNewsInfo;
import com.g5.edu.service.IDfNewsInfoService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 新闻表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2021-10-29
 */
@RestController
@RequestMapping("/edu/dfNewsInfo")
public class DfNewsInfoController {
    @Autowired
    private IDfNewsInfoService dfNewsInfoService;

    @GetMapping("/news_list")
    //分页列表
    public PageInfo<DfNewsInfo> news_list(Integer pageNum,Integer pageSize,Integer page){
        //设置显示页数
        if(pageNum == null){
            pageNum = 1;
        }
        if (page == null) {
            page = 1;
        }
        PageInfo<DfNewsInfo> pageInfo = dfNewsInfoService
                .getNews(pageNum,pageSize,page);
        return pageInfo;
    }

}
